@echo off
echo ==========================================
echo    Building Final VC++2005 DevOps Platform  
echo ==========================================

call "C:\Program Files (x86)\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86

if not exist build mkdir build

echo Step 1: Compiling final version...
cl.exe /nologo /c /MT /O2 /DNDEBUG /Isrc /Fobuild\main_final.obj src\main-final.cpp

if %errorlevel% neq 0 (
    echo ❌ Compilation failed!
    exit /b 1
)

echo Step 2: Linking final executable...
link.exe /nologo /OUT:build\DevOpsPlatform-final.exe build\main_final.obj kernel32.lib user32.lib

if %errorlevel% equ 0 (
    echo.
    echo ✅ FINAL BUILD SUCCESSFUL!
    echo ==========================================
    build\DevOpsPlatform-final.exe status
) else (
    echo ❌ Linking failed!
    exit /b 1
)
